package com.dong.es.entity.searchparam.order;

import co.elastic.clients.elasticsearch.core.SearchRequest;
import com.dong.es.entity.EsBaseDTO;
import com.dong.es.entity.searchparam.EsSearchParam;

import java.util.ArrayList;

/**
 * @description: Es 排序参数
 * @author: 陈瑞东
 * @create: 2022-06-23 10:46
 */
public abstract class EsSortParam extends EsSearchParam<SearchRequest.Builder> {

    private static final long serialVersionUID = 7697330379813217088L;

    @Override
    protected void addMethod(EsBaseDTO esBaseDTO) {
        esBaseDTO.sort(this);
    }

    @Override
    protected void setMethod(EsBaseDTO esBaseDTO) {
        esBaseDTO.setSort(new ArrayList<>());
        esBaseDTO.sort(this);
    }
}
